<template>
  <div v-if="isShowReturn" :style="{ 'background': returnColor }" class="flag"/>
</template>
<script>
import { dynamicColor } from '@/utils/ventureColorCfg';
export default {
  name: 'ResourceFlag',
  props: {
    resourceId: {
      type: Number,
      default: -1
    }
  },
  computed: {
    isShowReturn() {
      if (this.resourceId in dynamicColor) {
        return true;
      } else {
        return false;
      }
    },
    returnColor() {
      if (this.resourceId in dynamicColor) {
        return dynamicColor[this.resourceId];
      } else {
        return '#fff';
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.flag {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  margin: 0 8px 0 0px;
  flex-shrink: 0;
}
</style>
